<?php

namespace addons\travel\listener\order;

use addons\sum\exception\Exception;
use addons\sum\model\Config;
use addons\travel\model\Order;
use think\Db;

/**
 * 订单确认收货
 */
class Confirm
{
    // 订单确认收货后
    public function orderConfirmAfter(&$params)
    {
        $order = $params['order'];
        $order = Order::where('id', $order['id'])->find();

        // 更新收货时间
        $order->ext = json_encode($order->setExt($order, ['confirm_time' => time()]));      // 收货时间
        $order->save();

        return $order;
    }
}
